<?php

class UIField {
	private $ui;
	private $field;
	public function __construct(UIObject $ui,$metafield_or_metaslave){
		$this->ui = $ui;
		$this->field = $metafield_or_metaslave;
	}
	
	public function GetUIObject(){ return $this->ui; }
	public function GetObject(){ return $this->ui->GetObject(); }	
	public function GetField(){ return $this->field; }
	
	public function GetValue(){
		$o = $this->ui->GetObject();
		$f = $this->field->GetName();
		return $o->$f;
	}
	public function SetValue($value){
		$o = $this->ui->GetObject();
		$f = $this->field->GetName();
		$o->$f = $value;	
	}
	public function GetName(){
		return 'x'.ID::Hash($this->ui->GetName().$this->field->GetName())->AsHex();
	}
	public function GetLabel(){
		return $this->field->GetLabel();
	}
	public function GetType(){
		return $this->field->GetType();
	}
}
	
	
?>